def insertion_sort(a):
    for i in range(1, len(a)):
        key = a[i]
        j = i - 1
        while j >= 0 and a[j] > key:
            a[j + 1] = a[j]
            j -= 1
        a[j + 1] = key
    return a


def shu_ru():
    n = int(input("请输入整数个数："))
    arr_2 = []

    for i in range(n):
        num = int(input("请输入第{}个整数：".format(i + 1)))
        arr_2.append(num)

    return arr_2


if __name__ == '__main__':
    arr_1 = shu_ru()
    sorted_arr = insertion_sort(arr_1)
    print("排序后的整数为：", sorted_arr)
